<%-- 
    Document   : modifyRec
    Created on : 21-mag-2013, 1.31.20
    Author     : Giuseppe
--%>
<%@page import="ejb.ArticoloUsato"%>
<%@page import="ejb.RecensioneEsterna"%>
<%@page import="java.util.List"%>
<%@page import="ejb.Piattaforma"%>
<%@page import="java.util.*"%>
<%@include file="wrapper.jsp" %>


<%
     RecensioneEsterna n=(RecensioneEsterna)request.getAttribute("recensione");
     String id = (n.getId()).toString();
     String url = n.getUrl();
     int scala=n.getVoto().getScala();
     double valutazione=n.getVoto().getValutazione();
     Utente utSession = (Utente)session.getAttribute("utente");
     String tipo = utSession.getTipo();
     List<ArticoloUsato> usatiDaConfermare= (List<ArticoloUsato>)session.getAttribute("usatiDaConfermare");
%>

<div class="container">
   <div class="row-fluid">
        <div class="span3 bs-docs-sidebar">
           <ul class="nav nav-list bs-docs-sidenav">
                 <% if(tipo.equals("a")){%>
                <li><a href="Controller?button=visualizzaRecensori"> 
                <button class="btn btn-large btn-inverse btn-block" style="width:210px"><i class="icon-white icon-th-list"></i> Tutti i Recensori</button> </a></li>
                <li><a href="Controller?button=aggiungiRecensoreAus"> 
                <button class="btn btn-large btn-inverse btn-block" style="width:210px"><i class="icon-white icon-plus"></i> Aggiungi Recensore</button> </a></li>
                <%}%>
                <% if(tipo.equals("r")){%>
                <li><a href="Controller?button=aggiungiRecensioneInternaAus"> 
                <button class="btn btn-large btn-inverse btn-block" style="width:210px"><i class="icon-white icon-plus"></i> Aggiungi Rec. Interna</button> </a></li>
                <li><a href="Controller?button=aggiungiRecensioneEsternaAus"> 
                <button class="btn btn-large btn-inverse btn-block" style="width:210px"><i class="icon-white icon-plus"></i> Aggiungi Rec. Esterna</button> </a></li>
                <%}%>
                <li><a href="Controller?button=visualizzaRecensioniInterne"> 
                <button class="btn btn-large btn-inverse btn-block" style="width:210px"><i class="icon-white icon-th-list"></i> Recensioni Interne</button> </a></li>
                <li><a href="Controller?button=visualizzaRecensioniEsterne"> 
                <button class="btn btn-large btn-inverse btn-block" style="width:210px"><i class="icon-white icon-th-list"></i> Recensioni Esterne</button> </a></li>
            </ul>
        </div>   

<div class="span6">   
    <h3>Modifica Recensione Esterna</h3>
    <form class="form-horizontal" action="Controller" method="POST" onsubmit="return checkEditExternal(this)">
        <input name="id" type="hidden" value='<%=id%>'>
    <div class="control-group">
    <label class="control-label" for="inputNome">Url:</label>
    <div class="controls">
      <input name="url" type="text" id="inputUrl" readonly="readonly" value="<%=url%>" placeholder="Url">
    </div>
    </div>
    
    <div class="control-group">
    <label class="control-label" for="inputVoto">Voto:</label>
    <div class="controls">
    <input name="voto" type="text" id="inputVoto"   value="<%=valutazione%>">
    </div>
    </div>
    <div class="control-group">
    <label class="control-label" for="inputScala">Scala:</label>
    <div class="controls">
    <input name="scala" type="text" id="inputScala"   value="<%=scala%>">
    </div>
    </div>
      <label id="erroreDati" style="padding-left: 170px;color: red;"></label>
    <div class="control-group">
        <label class="control-label" style="padding-left: 170px"><button  class="btn btn-small btn-inverse btn success" type="submit" value="modificaRecensioneEsterna" name="button"><i class="icon-white icon-ok"></i>  Modifica Recensione</button></label>
    </div>
 </form>
</div>
   
<div class="span3">
    <% if(tipo.equals("a")){%>
    <div class="thumbnail">
                 <p><b>Notes</b></p>
                 <br>
                 <% if(!usatiDaConfermare.isEmpty()){%>
                    <p> Ancora <%=usatiDaConfermare.size()%> articoli da confermare </p>
                    <br>
                    <p align="center">
                        <a href="Controller?button=modificaCancellaArtUsati&amp;confirm=s">
                            <button class="btn btn-inverse btn-small"><i class="icon-white icon-th-list"></i> Vedi Articoli da confermare</button>
                        </a>
                    </p>
                 <%}else{%>
                 <p> Nessun articolo da confermare </p>
                <%}%>      
            </div>
      <%}%>   
      </div>          
   </div>
</div>
</body>
